﻿@model CultuRAM.Models.EventPropertyValue

@{
    ViewBag.Title = "Criar Nova Propriedade";   
}

    <h4>Adicionar Nova Propriedade</h4>
    <br />
    @using (Ajax.BeginForm("CreatePv", "EventPropertyValues", new AjaxOptions
        {
            UpdateTargetId = "tabEventPropRight",
            InsertionMode = InsertionMode.Replace,
            HttpMethod = "POST",
            OnSuccess = "UpdateEventProp(" + @Model.EventId + ")"
        }))
    {
    
   @* @Html.ValidationSummary(false) *@

        <fieldset>
            <legend>Propriedade</legend>
        
            @Html.HiddenFor(model => model.PropertyValueId)
            @Html.HiddenFor(model => model.EventId, new { id = "EventId" }) @*//NAO ALTERAR*@
            @*@Html.HiddenFor(model => model.Event.Title)*@
            @*@Html.HiddenFor(model => model.EventProperty.PropertyId,  new { id = "EventPropertyId" })*@
        

            <div class="control-group">
                @Html.LabelFor(model => model.EventProperty)
                <div class="controls">
                    @Html.DropDownListFor(model => model.EventPropertyId, (SelectList)ViewBag.EventPropertyIdDdl, "- Selecione -" , new { id = "EventPropertyId" })
                    @*@Html.HiddenFor(model => model.EventProperty)*@
                    @*@Html.ValidationMessageFor(model => model.EventProperty.PropertyId)*@
                </div>
            </div>

            <div class="control-group">
                @Html.LabelFor(model => model.Value)          
                <div id="divValue" class="controls">           
                    @Html.DropDownListFor(model => model.Value, (SelectList)ViewBag.EventStates, "- Selecione -", new { @id="ddl1", @style = "display:none;"})
                    @Html.DropDownListFor(model => model.Value, (SelectList)ViewBag.Places, "- Selecione -", new { @id="ddl2", @style = "display:none;"})
                    @Html.DropDownListFor(model => model.Value, (SelectList)ViewBag.WeekDays, "- Selecione -", new { @id="ddl3", @style = "display:none;"})
                    @Html.DropDownListFor(model => model.Value, (SelectList)ViewBag.Targets, "- Selecione -", new { @id="ddl4", @style = "display:none;"})
                    @Html.DropDownListFor(model => model.Value, (SelectList)ViewBag.YesNo, "- Selecione -", new { @id="ddl5", @style = "display:none;"})
                    @Html.TextBoxFor(model => model.Value, new { @id="txt"})
                    @Html.TextAreaFor(model => model.Value, new { @id="txta", @style="height: 100px; width: 98% !important; display:none;"}) 
                    @*@Html.ValidationMessageFor(model => model.Value)*@

                    @*@Html.TextAreaFor(model => model.Value, new { @id="txta", @style="height: 100px; width: 98% !important; display:none;"})*@ 
                    @*@Html.RadioButtonFor(model => model.Value, "Sim" , new { id = "yes",  @class="radioInline"}) @Html.Label("yes",String.Empty + "Sim") 
                @Html.RadioButtonFor(model => model.Value, "Não" , new { id = "no",  @class="radioInline"}) @Html.Label("no", String.Empty + "Não")*@
                </div>
            </div>

            <br/>
            @*<input type="submit" value="Guardar" class="btn btn-primary"/>*@
            <button type="submit" value="Guardar" class="btn btn-primary"><i class="icon-ok icon-white"></i> Guardar </button>
@*            @Ajax.ActionLink("Cancelar", "Default", null, new AjaxOptions()
                {
                    UpdateTargetId = "tabEventPropRight",
                    InsertionMode = InsertionMode.Replace,
                    OnSuccess = "BgColorClear()",
                }, new { @class = "btn btn-default" })*@

            @Html.Raw(@Ajax.ActionLink("replacetxt", "Default", null, new AjaxOptions
		        {
			            UpdateTargetId="tabEventPropRight", 
                        InsertionMode = InsertionMode.Replace, 
                        HttpMethod = "GET", 
                        OnComplete = "PropBgColorClear()"
		        }, new { @class = "btn btn-default" })
		        .ToHtmlString().Replace("replacetxt", "<i class=\"icon-ban-circle\"></i> Cancelar"))
            

        </fieldset>
    }



@Scripts.Render("~/bundles/culturam")

